package com.imooc.uaa.domain.dto;

import com.imooc.uaa.annotation.ValidEmail;
import com.imooc.uaa.annotation.ValidPassword;
import com.imooc.uaa.annotation.ValidPasswordMatch;
import com.imooc.uaa.config.Constants;
import lombok.Data;

import javax.validation.constraints.*;

@Data
@ValidPasswordMatch
public class UserDto {
    @NotNull
    @NotBlank
    @Size(min = 4, max = 50, message = "用户名长度必须在4到50个字符之间")
    private String username;
    @Pattern(regexp = Constants.PATTERN_MOBILE)
    @NotNull
    private String mobile;
    @ValidPassword
    private String password;
    private String matchingPassword;
    @NotNull
    @NotBlank
    @ValidEmail
    private String email;
    @NotNull
    @NotBlank
    @Size(min = 2, max = 50, message = "用户名长度必须在4到50个字符之间")
    private String name;
}
